package xiaohong.algorithm;

public class LongestSubstring {

    public static void main(String[] args) {
        String str = "abcabcbb";
        String str1 = "bbbbb";
        String str2 = "pwwkew";

        System.out.println(lengthOfLongestSubstring(str));
        System.out.println(lengthOfLongestSubstring(str1));
        System.out.println(lengthOfLongestSubstring(str2));
    }

    public static int lengthOfLongestSubstring(String s) {
        if (s == null || s.length() == 0)
            return 0;
        int max = 0;
        int start = 0;
        int end = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == s.charAt(end)) {

            }
            start++;
            end++;
            if (end == s.length() - 1) {
                break;
            }
        }
        return max;
    }


}
